const CompressionWebpackPlugin = require("compression-webpack-plugin");
const productionGzipExtensions = ["js", "css"];

module.exports = {
    lintOnSave:false,
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    },
    configureWebpack:{
        plugins: [
            new CompressionWebpackPlugin({
                test: /\.(js|css)$/, // 匹配文件名
                algorithm: 'gzip',
                threshold: 10240, // 对超过10k的数据压缩
                minRatio: 0.8,
                deleteOriginalAssets: false // 不删除源文件
            })
        ],
    },

    devServer: {
        port: 8080,
        proxy: {
            '/note/api': {
                target: 'http://localhost:1786', //  请求本地 需要jeecg-boot后台项目
                // pathRewrite: { '/gdsc-boot/gdsc-boot': '/gdsc-boot' },
                ws: true,
                changeOrigin: true
            }
        }
    },
}